home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / mm / ccmd / brk.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-18  |  868 b   |  34 lines

  1. /*
  2.  Copyright (c) 1986, 1990 by The Trustees of Columbia University in
  3.  the City of New York.  Permission is granted to any individual or
  4.  institution to use, copy, or redistribute this software so long as it
  5.  is not sold for profit, provided this copyright notice is retained.
  6.  
  7. */
  8. #include <stdio.h>
  9. main(argc,argv) int argc; char **argv; {
  10.   unsigned char x[16];
  11.   int i;  
  12.   char *bp;
  13.  
  14.   if (argc != 2)  {
  15.     fprintf(stderr,"expecting 1 arg\n");
  16.     exit(1);
  17.   }
  18.   for (i = 0; i < 16; i++) x[i] = 0xff;
  19.   for (i = 1; i < 128; i++)
  20.     if (bp = (char *)index(argv[1],i)) {
  21.       printf("%c\n",*bp);
  22.       x[i/8] &= ~(1 << 7-(i%8));
  23.     }
  24.   x[0] |= 0x80;                /* don't handle nulls */
  25.   for (i = 0; i < 16; i++) {
  26.     if (!(i % 8)) printf("\n\t");    /* split in half */
  27.     printf("0x");
  28.     if (x[i] < 0x10) printf("0");
  29.     printf("%x, ",x[i]);
  30.   }
  31.   printf("\n");
  32. }
  33.  
  34.